package com.ruoyi.miniapp.api.factory;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.miniapp.api.RemoteMiniappLogService;
import com.ruoyi.miniapp.api.domain.MiniappLogininfor;
import com.ruoyi.miniapp.api.domain.MiniappOperLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteMiniappLogFallbackFactory  implements FallbackFactory<RemoteMiniappLogService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteMiniappLogService.class);

    @Override
    public RemoteMiniappLogService create(Throwable throwable)
    {
        log.error("日志服务调用失败:{}", throwable.getMessage());
        return new RemoteMiniappLogService()
        {
            @Override
            public R<Boolean> saveLog(MiniappOperLog miniappOperLog, String source)
            {
                return null;
            }

            @Override
            public R<Boolean> saveLogininfor(MiniappLogininfor miniappLogininfor, String source)
            {
                return null;
            }
        };

    }
}
